/**
 * BatchQuartzLauncherJob.java - 2012-3-14
 *
 * Licensed Property to China UnionPay Co., Ltd.
 * 
 * (C) Copyright of China UnionPay Co., Ltd. 2010
 *     All Rights Reserved.
 *
 * Project Info: China UnionPay Internet Acquiring Project
 * 
 * Modification History:
 * =============================================================================
 *   Author         Date          Description
 *   ------------ ---------- ---------------------------------------------------
 *        
 * =============================================================================
 */
package com.lijin.batchsys.framework.schedule;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.lijin.batchsys.framework.common.BatchSysConstants;
import com.lijin.batchsys.framework.common.BatchUtil;
import com.lijin.batchsys.framework.control.BatchControl;
import com.lijin.batchsys.framework.enums.RunningMode;

/**
 * Description:
 * 
 * (C) Copyright of China UnionPay Co., Ltd. 2010.
 * 
 */
public class BatchQuartzLauncherJob implements Job {

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		JobDataMap jdm = context.getJobDetail().getJobDataMap();

		System.out.println("=======定时任务拉起批次【" + jdm + "】 开始=======");

		BatchControl.startBatch(RunningMode.START_BATCH, BatchUtil.preDay(new Date()), jdm
				.getInt(BatchSysConstants.SCHEDULE_BATCH_NO_KEY), 0, 0);

		System.out.println("=======定时任务拉起批次【" + jdm + "】 完成=======");
	}

}
